Skip to content

feat(fields): add Mersenne31 circle domain skeleton - #3

Draft
adrienlacombe wants to merge 10 commits into
pr257-mersenne31-basefrom
feat/mersenne31-circle-domain
Draft

feat(fields): add Mersenne31 circle domain skeleton#3
adrienlacombe wants to merge 10 commits into
pr257-mersenne31-basefrom
feat/mersenne31-circle-domain

Conversation

@adrienlacombe

@adrienlacombe adrienlacombe commented Jun 26, 2026

Copy link
Copy Markdown
Owner

Summary

Adds a STWO-style circle-domain skeleton on top of the Mersenne31 field work in Verified-zkEVM#257. The branch has been refreshed onto Verified-zkEVM#257 commit 5068d4c and adapted to the current Lean module layout.

Changes

  • Adds CompPoly.Fields.Mersenne31.Circle.
  • Defines Mersenne31 circle points as pairs satisfying x^2 + y^2 = 1.
  • Records STWO's M31 circle generator (2, 1268011823) and proves it lies on the circle.
  • Adds circle point conjugation, antipode, addition, and repeated addition.
  • Defines CirclePointIndex modulo 2^31, subgroup generator indices, cosets, conjugate cosets, circle domains, and canonical cosets.
  • Proves structural domain facts: coset size/index stepping, conjugate index ordering, domain size, and canonical-domain log size.
  • Adds regression tests for generator, subgroup index, coset, domain, and canonical-domain behavior.
  • Exports the new source and test modules through the generated library and test aggregates.

Non-goals

This intentionally does not prove the generator has order 2^31, nor does it formalize FRI or circle polynomial evaluation. Those are follow-on PRs after the domain skeleton stabilizes.

Validation

  • lake build CompPoly.Fields.Mersenne31.Circle CompPolyTests.Fields.Mersenne31.Circle
  • ./scripts/update-lib.sh
  • ./scripts/check-imports.sh
  • ./scripts/lint-style.sh
  • lake test
  • git diff --check

Stack note

This draft targets adrienlacombe:pr257-mersenne31-base, which now mirrors the current Verified-zkEVM#257 head at 5068d4c. The PR-specific diff is five files: the circle source and tests plus their facade and aggregate imports.

@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown

Build Timing Report

  • Commit: 0e58b0e
  • Message: Merge 5116e0f into 5068d4c
  • Ref: feat/mersenne31-circle-domain
  • Measured on ubuntu-latest with /usr/bin/time -p.
  • Commands: library build (warm) lake build; test path lake test.
  • Clean build was skipped (warm/incremental CI; no toolchain or lake-manifest change). Runs automatically when lean-toolchain or lake-manifest.json changes, or via Actions → Lean Action CI → Run workflow with clean_build.
Measurement Wall (s) Status
Library build (warm) 9.28 ok
Test path 3.66 ok

Incremental Rebuild Signal

  • Warm-only run: default CI reuses cached oleans and rebuilds dirty modules only. No same-job clean:warm ratio.

Slowest Current Build Files (warm library build)

Showing 6 slowest of 6 repo targets parsed from the current warm library build log.

Wall (s) Path
3.10 CompPoly/Fields/Mersenne31/Fast.lean
1.80 CompPoly/Fields/Mersenne31/Basic.lean
1.70 CompPoly/Fields/Mersenne31/Circle.lean
1.10 CompPoly.lean
0.94 CompPoly/Fields/Mersenne.lean
0.92 CompPoly/Fields/Mersenne31.lean

@adrienlacombe
adrienlacombe force-pushed the pr257-mersenne31-base branch from 5742dfa to 5068d4c Compare August 26, 2026 08:07
adrienlacombe and others added 4 commits August 26, 2026 10:53
Require logSize bounds on subgroupGen, document toPoint limitations,
add toPoint/add_zero lemmas, and expand circle regression tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
- Rename `Point.add_zero` (proves `0 + p = p`) to `Point.zero_add` to
  match the repo's Mathlib-style naming convention.
- Drop the discarded `logSize ≤ logOrder` argument from
  `CirclePointIndex.subgroupGen`; the body is total, and callers
  (`Coset.new`, `odds`, `halfOdds`) carry the bound where it is needed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@adrienlacombe
adrienlacombe force-pushed the feat/mersenne31-circle-domain branch from fac0909 to 5116e0f Compare August 26, 2026 08:58
@adrienlacombe adrienlacombe changed the title [codex] Add Mersenne31 circle domain skeleton feat(fields): add Mersenne31 circle domain skeleton Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants